1. Field of the Invention
The present invention relates to a method of erasing a flash memory, and more particularly to a method of erasing a flash memory which can reduce time needed to erase a flash memory made of stack gate type cells.
2. Description of the Prior Art
Typically, a flash memory cain be manufactured by a split gate type cell or a stack gate type cell. An internal erasure algorithm has being used to erase the flash memory having stack gate cells. Such an internal erasure algorithm comprises a pre-program step to prevent the over-erasing, an erasing step, and a post-program step. Namely, the pre-program step is executed in sectors before executing the erasing step so that threshold voltage of all cells are set to a desired voltage. The erasing step and the post-program step are sequentially executed, whereby over erased cells are recovered and the flash memory is normally erased.
FIG. 1 is a block diagram for explaining a conventional method of erasing a flash memory, and is divided into a pre-program block 11, an erasing block 12, and a post-program block 13. The pre-program block 11 has a pre-program step 101 and a pre-program verification step 102. The pre-program step 101 is executed to prevent an over erasure of cells and the pre-program verification step 102 is executed to verify whether the threshold voltage of the pre-programmed cells is identical to a predetermined threshold voltage. The erasing block 12 has an erasing step 103 and an erasing verification step 104. The erasing step 103 is executed to erase the pre-programmed cells. The erasing verification step 104 is executed to verify whether the pre-programmed cells are normally erased. The post-program block 13 has a post-program step 105 and a post-program verification step 106. The post-program step 105 is executed to recover over erased cells among the erased cells. The post-program verification step 106 is executed to verify whether the over erased cells are recovered.
FIG. 2 is a flow chart for explaining a conventional method of erasing a flash memory. If an erasing command is input (201), an address counter and a fail counter are reset. According to a pre-program command(202), cells selected by addresses are programmed in bytes or words (203). To verify whether the cells are programmed, program verification is executed(204). As the result of the program verification, a step(205) is executed to check whether the program verification is passed. If the program verification is not passed as the results of the above step(205), a step(206) is executed to check whether the fail counter is a maximum. If the fail counter is maximum, the erasing process is considered as failure and the erasing process is ended. If the fail counter is not maximum, the counter value of the fail counter is increased(202) and the above steps(203, 204, 205) are executed again. If the program verification is successfully passed as the result of the above step(205), a step(208) is executed to check whether the address is the final address of the sector. If the address is not the final address of the sector, the address is increased(209) and the steps (203,204,205 and 208) are executed again. If the address is the final address of the sector as the result of the above step(208), the address and the fail counter are reset and an erasing step starts(210).
Information stored on the cells is erased according to the erasing command(211). In a step(212), an erasure verification is executed. In a step(213), it decides whether the erasure verification is passed. As the result of the above step(213), if the erasure verification is not passed, it is decided whether the fail counter is maximum at a step(214). If the fail counter is not maximum, counter value of the fail counter is increased(215) and the above steps(211, 212, 213) are executed again. If the fail counter is maximum, the erasure operation is ended. As the result of the above step(213), if the erasure verification is passed, it is decided whether a current address is the final address of the sector(216). If it is not the final address, the current address is increased by an address counter(217) and the above step are executed again. If the current address is the final address, the address counter and the fail counter are reset and a post-program is executed(218). The post-program verification is executed at a step(219). In a step(220), it is decided whether the post-program verification is passed. As the result of the above step(220), if the post-program verification is not passed, it is decided whether the fail counter is maximum at a step(221). If the fail counter is not maximum, counter value of the fail counter is increased(215) and the above steps(218, 219, 220) are executed again. If the fail counter is maximum, the post-program is ended. As the result of the above step(220), if the post-program verification is passed, it is decided whether a current address is the final sector address(223). As the result of the above step(223), if the current address is not the final address of the sector, the current address is increased by the address counter(224) and the above steps(218, 219, and 220) are executed again. As result of the above step(223), if the current address is the final address of the sector, an erasure operation is considered as pass and the erasure operation is ended.
However, such erasing method needs much erasing time for the pre-program step and the post-program step related to over-erased cells, not to an actual erasing process, and for verification time of each step.